<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box,.box1{
            display: flex;
            width: 500px;
            height: 350px;
            margin: 50;
            border: 1px solid red;
        }
        .box{
            align-items: center;
        }
        .inner,.inner1{
            width: 100px;
            height: 100px;
            background-color: violet;
        }
        .box1{
            align-items: flex-end;
        }
        /* justify-content: flex-end;
        .inner1:first-child{
            margin-left: auto;
        } */

        /* justify-content: center;
        .inner1:first-child{
            margin-left: auto;
        }
        .inner1:last-child{
            margin-right: auto;
        } */

        /* justify-content: space-between;
        .inner1{
            margin-left: auto;
        }
        .inner1:first-child{
            margin-left: 0;
        } */

        /* justify-content: space-around;
        .inner1{
            margin: 0 auto;
        } */

        /* justify-content: space-evenly;
        .inner1{
            margin-left: auto;
        }
        .inner1:last-child{
            margin-right: auto;
        } */

        /* align-items: flex-end;
        .inner1{
            margin-top: auto;
        } */

        /* align-items: center;
        .inner1{
            margin: auto 0;
        } */
    </style>
</head>
<body>
    <div class="box">
        <div class="inner">1</div>
        <div class="inner">2</div>
        <div class="inner">3</div>
        <div class="inner">4</div>
        <!-- <div class="inner">5</div>
        <div class="inner">6</div>
        <div class="inner">7</div>
        <div class="inner">8</div> -->
    </div>
    
    <div class="box1">
        <div class="inner1">1</div>
        <div class="inner1">2</div>
        <div class="inner1">3</div>
        <div class="inner1">4</div>
        <!-- <div class="inner1">5</div>
        <div class="inner1">6</div>
        <div class="inner1">7</div>
        <div class="inner1">8</div> -->
    </div>
	<p>在弹性容器中给弹性元素设置margin: auto，那么弹性元素将占据设置了margin: auto方向的所有剩余空间</p>
</body>
</html>